package model

type Cart struct {
	Id        string
	Tcount    int
	Tamout    float64
	CartItems []*CartItem
	Userid    int
}

func (this *Cart) GetTcount() (Tcount int) {
	for _, v := range this.CartItems {
		Tcount += v.Count
	}
	return
}

func (this *Cart) GetTamout() (Tamout float64) {
	for _, v := range this.CartItems {
		Tamout += v.GetAmout()
	}
	return
}
